\(\int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx\) [1035]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 38, antiderivative size = 102 \[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\frac {(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-2-p}}{f g (3+p)}+\frac {(A-B (2+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{c f g (1+p) (3+p)} \]

[Out]

(A+B)*(g*cos(f*x+e))^(p+1)*(c-c*sin(f*x+e))^(-2-p)/f/g/(3+p)+(A-B*(2+p))*(g*cos(f*x+e))^(p+1)*(c-c*sin(f*x+e))
^(-1-p)/c/f/g/(p^2+4*p+3)

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {2938, 2750} \[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\frac {(A+B) (c-c \sin (e+f x))^{-p-2} (g \cos (e+f x))^{p+1}}{f g (p+3)}+\frac {(A-B (p+2)) (c-c \sin (e+f x))^{-p-1} (g \cos (e+f x))^{p+1}}{c f g (p+1) (p+3)} \]

[In]

Int[(g*Cos[e + f*x])^p*(A + B*Sin[e + f*x])*(c - c*Sin[e + f*x])^(-2 - p),x]

[Out]

((A + B)*(g*Cos[e + f*x])^(1 + p)*(c - c*Sin[e + f*x])^(-2 - p))/(f*g*(3 + p)) + ((A - B*(2 + p))*(g*Cos[e + f
*x])^(1 + p)*(c - c*Sin[e + f*x])^(-1 - p))/(c*f*g*(1 + p)*(3 + p))

Rule 2750

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[b*(g*C
os[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(a*f*g*m)), x] /; FreeQ[{a, b, e, f, g, m, p}, x] && EqQ[a^2 - b^
2, 0] && EqQ[Simplify[m + p + 1], 0] &&  !ILtQ[p, 0]

Rule 2938

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)]), x_Symbol] :> Simp[(b*c - a*d)*(g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(a*f*g*(2*m + p
 + 1))), x] + Dist[(a*d*m + b*c*(m + p + 1))/(a*b*(2*m + p + 1)), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e + f*x])^
(m + 1), x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && EqQ[a^2 - b^2, 0] && (LtQ[m, -1] || ILtQ[Simplify[
m + p], 0]) && NeQ[2*m + p + 1, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-2-p}}{f g (3+p)}+\frac {(A-B (2+p)) \int (g \cos (e+f x))^p (c-c \sin (e+f x))^{-1-p} \, dx}{c (3+p)} \\ & = \frac {(A+B) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-2-p}}{f g (3+p)}+\frac {(A-B (2+p)) (g \cos (e+f x))^{1+p} (c-c \sin (e+f x))^{-1-p}}{c f g (1+p) (3+p)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.81 \[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\frac {\cos (e+f x) (g \cos (e+f x))^p (c-c \sin (e+f x))^{-p} (-B+A (2+p)+(-A+B (2+p)) \sin (e+f x))}{c^2 f (1+p) (3+p) (-1+\sin (e+f x))^2} \]

[In]

Integrate[(g*Cos[e + f*x])^p*(A + B*Sin[e + f*x])*(c - c*Sin[e + f*x])^(-2 - p),x]

[Out]

(Cos[e + f*x]*(g*Cos[e + f*x])^p*(-B + A*(2 + p) + (-A + B*(2 + p))*Sin[e + f*x]))/(c^2*f*(1 + p)*(3 + p)*(-1
+ Sin[e + f*x])^2*(c - c*Sin[e + f*x])^p)

Maple [F]

\[\int \left (g \cos \left (f x +e \right )\right )^{p} \left (A +B \sin \left (f x +e \right )\right ) \left (c -c \sin \left (f x +e \right )\right )^{-2-p}d x\]

[In]

int((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-2-p),x)

[Out]

int((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-2-p),x)

Fricas [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.82 \[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\frac {{\left ({\left (B p - A + 2 \, B\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + {\left (A p + 2 \, A - B\right )} \cos \left (f x + e\right )\right )} \left (g \cos \left (f x + e\right )\right )^{p} {\left (-c \sin \left (f x + e\right ) + c\right )}^{-p - 2}}{f p^{2} + 4 \, f p + 3 \, f} \]

[In]

integrate((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-2-p),x, algorithm="fricas")

[Out]

((B*p - A + 2*B)*cos(f*x + e)*sin(f*x + e) + (A*p + 2*A - B)*cos(f*x + e))*(g*cos(f*x + e))^p*(-c*sin(f*x + e)
 + c)^(-p - 2)/(f*p^2 + 4*f*p + 3*f)

Sympy [F]

\[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\int \left (g \cos {\left (e + f x \right )}\right )^{p} \left (- c \left (\sin {\left (e + f x \right )} - 1\right )\right )^{- p - 2} \left (A + B \sin {\left (e + f x \right )}\right )\, dx \]

[In]

integrate((g*cos(f*x+e))**p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))**(-2-p),x)

[Out]

Integral((g*cos(e + f*x))**p*(-c*(sin(e + f*x) - 1))**(-p - 2)*(A + B*sin(e + f*x)), x)

Maxima [F]

\[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\int { {\left (B \sin \left (f x + e\right ) + A\right )} \left (g \cos \left (f x + e\right )\right )^{p} {\left (-c \sin \left (f x + e\right ) + c\right )}^{-p - 2} \,d x } \]

[In]

integrate((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-2-p),x, algorithm="maxima")

[Out]

integrate((B*sin(f*x + e) + A)*(g*cos(f*x + e))^p*(-c*sin(f*x + e) + c)^(-p - 2), x)

Giac [F]

\[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=\int { {\left (B \sin \left (f x + e\right ) + A\right )} \left (g \cos \left (f x + e\right )\right )^{p} {\left (-c \sin \left (f x + e\right ) + c\right )}^{-p - 2} \,d x } \]

[In]

integrate((g*cos(f*x+e))^p*(A+B*sin(f*x+e))*(c-c*sin(f*x+e))^(-2-p),x, algorithm="giac")

[Out]

integrate((B*sin(f*x + e) + A)*(g*cos(f*x + e))^p*(-c*sin(f*x + e) + c)^(-p - 2), x)

Mupad [B] (verification not implemented)

Time = 1.39 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.26 \[ \int (g \cos (e+f x))^p (A+B \sin (e+f x)) (c-c \sin (e+f x))^{-2-p} \, dx=-\frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^p\,\left (4\,A\,\cos \left (e+f\,x\right )-2\,B\,\cos \left (e+f\,x\right )-A\,\sin \left (2\,e+2\,f\,x\right )+2\,B\,\sin \left (2\,e+2\,f\,x\right )+2\,A\,p\,\cos \left (e+f\,x\right )+B\,p\,\sin \left (2\,e+2\,f\,x\right )\right )}{c^2\,f\,{\left (-c\,\left (\sin \left (e+f\,x\right )-1\right )\right )}^p\,\left (4\,\sin \left (e+f\,x\right )+\cos \left (2\,e+2\,f\,x\right )-3\right )\,\left (p^2+4\,p+3\right )} \]

[In]

int(((g*cos(e + f*x))^p*(A + B*sin(e + f*x)))/(c - c*sin(e + f*x))^(p + 2),x)

[Out]

-((g*cos(e + f*x))^p*(4*A*cos(e + f*x) - 2*B*cos(e + f*x) - A*sin(2*e + 2*f*x) + 2*B*sin(2*e + 2*f*x) + 2*A*p*
cos(e + f*x) + B*p*sin(2*e + 2*f*x)))/(c^2*f*(-c*(sin(e + f*x) - 1))^p*(4*sin(e + f*x) + cos(2*e + 2*f*x) - 3)
*(4*p + p^2 + 3))